package com.lf.sys.service.impl;



import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.lf.sys.mapper.SysUserMapper;
import com.lf.sys.model.SysUser;
import com.lf.sys.service.UserService;

/**
 * 用户管理
 * */
@Service
public class UserServiceImp implements UserService{
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Resource
	public SysUserMapper sysUserMapper;

	
	/**
	 * 用户保存
	 * */
	public String saveUserInfo(SysUser sysUser) {
		
		logger.info("saveUserInfo=="+sysUser.getPassword());

		int i=sysUserMapper.insert(sysUser);
		return ""+i;
	}

	/**
	 * 根据id 删除用户
	 * */
	public String deleteUserByid(String id) {
		int i=sysUserMapper.deleteByPrimaryKey(Long.parseLong(id));
		return ""+i;
	}

	/**
	 * 查询用户列表
	 * */
	public List<SysUser> listUserInfo(String org) {

	
		
		return sysUserMapper.selectAll();
	}

	@Override
	public SysUser userInfoByid(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	
	
	
}
